//
//  LayersViewController.m
//
//  SFU Pathways 2012 by UGuideUs
//
//  Created by Tiffany Cheng on 12-07-03.
//

#import "LayersViewController.h"
#import "Annotation.h"

@interface LayersViewController() <MKMapViewDelegate>
@end

@implementation LayersViewController

@synthesize mapView = _mapView;
@synthesize locationmanager = _locationmanager;


/*  NAME:       viewDidLoad()
 *
 *  PURPOSE:    The series of tasks that should be done when the user enters this view (or starts
 *              the application).
 */

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    _mapView.mapType = MKMapTypeStandard;
    [mapDesc setTitle: @"Map" forState:UIControlStateNormal];
    [_mapView setZoomEnabled : YES];
    [_mapView setScrollEnabled : YES];
    
    MKCoordinateRegion region;
    
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [_mapView setRegion : region animated : YES];
    
    [_mapView setDelegate : self];
    
}


/*  NAME:       reveal() and hide()
 *
 *  PURPOSE:    Turns off the keyboard after the user presses return on it.
 */

- (IBAction)reveal : (id)sender 
{
    if (buttonA.hidden)
    {
        buttonA.hidden = NO;
        buttonC.hidden = NO;
        buttonF.hidden = NO;
        buttonT.hidden = NO;
        buttonW.hidden = NO;
    }
    else
        [self hide];
    
}


- (void)hide
{
    buttonA.hidden = YES;
    buttonC.hidden = YES;
    buttonF.hidden = YES;
    buttonT.hidden = YES;
    buttonW.hidden = YES;
}


/*  NAME:       mapView :: viewForAnnotation()
 *
 *  PURPOSE:    Controls the displaying of a room annotation when the room's pin is queried.
 */

- (MKAnnotationView *) mapView : (MKMapView *)mapView 
            viewForAnnotation : (id<MKAnnotation>)annotation
{
    MKPinAnnotationView *MyPin = [[MKPinAnnotationView alloc] initWithAnnotation : annotation reuseIdentifier : @"current"];
    
    MyPin.pinColor = MKPinAnnotationColorGreen;
    
    MyPin.draggable  = NO;
    MyPin.highlighted = YES;
    MyPin.animatesDrop = TRUE;
    MyPin.canShowCallout = YES;
    
    return MyPin;
}


/*  NAME:       show*(), go*()
 *
 *  PURPOSE:    Controls the displaying of a room annotation when the room's pin is queried.
 */

- (IBAction)showATM : (id)sender
{
    [buttonA setSelected : YES];
    [buttonC setSelected : NO];
    [buttonF setSelected : NO];
    [buttonT setSelected : NO];
    [buttonW setSelected : NO];
    [self goATM];
}

- (IBAction)showComputer : (id)sender
{
    [buttonC setSelected : YES];
    [buttonA setSelected : NO];
    [buttonF setSelected : NO];
    [buttonT setSelected : NO];
    [buttonW setSelected : NO];
    [self goComp];  
}

- (IBAction)showFood : (id)sender
{
    [buttonF setSelected : YES];
    [buttonC setSelected : NO];
    [buttonA setSelected : NO];
    [buttonT setSelected : NO];
    [buttonW setSelected : NO];
    [self goFood];
}

- (IBAction)showBus : (id)sender
{
    [buttonT setSelected : YES];
    [buttonC setSelected : NO];
    [buttonF setSelected : NO];
    [buttonA setSelected : NO];
    [buttonW setSelected : NO];
    [self goBus];    
}

- (IBAction)showPark : (id)sender
{
    [buttonW setSelected : YES];
    [buttonC setSelected : NO];
    [buttonF setSelected : NO];
    [buttonT setSelected : NO];
    [buttonA setSelected : NO];
    [self goPark];
}


//  goATM() contains coordinates for ATMs.

- (void) goATM
{
    MKCoordinateRegion region;
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [self.mapView removeAnnotations : self.mapView.annotations];
    
    Annotation *ann1 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor1;
    coor1.latitude = 49.277988;
    coor1.longitude = -122.911335;
    ann1.title = @"Scotiabank (Branch)";
    ann1.coordinate = coor1;
    [_mapView addAnnotation : ann1]; 
    
    Annotation *ann2 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor2;
    coor2.latitude = 49.279972;
    coor2.longitude = -122.922268;
    ann2.title = @"Scotiabank (WMC)";
    ann2.coordinate = coor2;
    [_mapView addAnnotation : ann2];
    
    Annotation *ann3 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor3;
    coor3.latitude = 49.278952;
    coor3.longitude = -122.919208;
    ann3.title = @"Scotiabank (MBC)";
    ann3.coordinate = coor3;
    [_mapView addAnnotation : ann3];
    
    Annotation *ann4 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor4;
    coor4.latitude = 49.2794;
    coor4.longitude = -122.915723;
    ann4.title = @"Scotiabank (AQ)";
    ann4.coordinate = coor4;
    [_mapView addAnnotation : ann4];  
    
    Annotation *ann5 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor5;
    coor5.latitude = 49.277804;
    coor5.longitude = -122.909935;
    ann5.title = @"Mastercard (Nester's Market)";
    ann5.coordinate = coor5;
    [_mapView addAnnotation : ann5];    
    
    [_mapView setRegion : region animated : YES];
} //end goATM


//  goComp() contains coordinates for computer labs.

- (void) goComp
{
    MKCoordinateRegion region;
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [self.mapView removeAnnotations : self.mapView.annotations];
    
    Annotation *ann1 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor1;
    coor1.latitude = 49.277669;
    coor1.longitude = -122.914442;
    ann1.title = @"ASB 9838";
    ann1.subtitle = @"CSIL Lab";
    ann1.coordinate = coor1;
    [_mapView addAnnotation : ann1]; 
    
    Annotation *ann2 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor2;
    coor2.latitude = 49.277659;
    coor2.longitude = -122.914300;
    ann2.title = @"ASB 9804";
    ann2.subtitle = @"CSIL Lab";
    ann2.coordinate = coor2;
    [_mapView addAnnotation : ann2];
    
    Annotation *ann3 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor3;
    coor3.latitude = 49.277526;
    coor3.longitude = -122.914322;
    ann3.title = @"ASB 9840";
    ann3.subtitle = @"CSIL Lab";
    ann3.coordinate = coor3;
    [_mapView addAnnotation : ann3];
    
    Annotation *ann4 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor4;
    coor4.latitude = 49.277724;
    coor4.longitude = -122.914465;
    ann4.title = @"ASB 9818";
    ann4.subtitle = @"CSIL Lab";
    ann4.coordinate = coor4;
    [_mapView addAnnotation : ann4];
    
    Annotation *ann5 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor5;
    coor5.latitude = 49.277760;
    coor5.longitude = -122.914413;
    ann5.title = @"ASB 9700";
    ann5.subtitle = @"CSIL Lab";
    ann5.coordinate = coor5;
    [_mapView addAnnotation : ann5];
    
    Annotation *ann6 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor6;
    coor6.latitude = 49.279213;
    coor6.longitude = -122.915659;
    ann6.title = @"AQ 3145";
    ann6.subtitle = @"CIC Lab 1";
    ann6.coordinate = coor6;
    [_mapView addAnnotation : ann6];
    
    Annotation *ann7 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor7;
    coor7.latitude = 49.279193;
    coor7.longitude = -122.915637;
    ann7.title = @"AQ 3145.2";
    ann7.subtitle = @"CIC Lab 2";
    ann7.coordinate = coor7;
    [_mapView addAnnotation : ann7];
    
    Annotation *ann8 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor8;
    coor8.latitude = 49.279292;
    coor8.longitude = -122.915590;
    ann8.title = @"AQ 3144";
    ann8.subtitle = @"East Concourse";
    ann8.coordinate = coor8;
    [_mapView addAnnotation : ann8];
    
    Annotation *ann9 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor9;
    coor9.latitude = 49.279642;
    coor9.longitude = -122.918734;
    ann9.title = @"Information Commons";
    ann9.subtitle = @"library 3rd floor";
    ann9.coordinate = coor9;
    [_mapView addAnnotation : ann9];
    
    Annotation *ann10 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor10;
    coor10.latitude = 49.278947;
    coor10.longitude = -122.915726;
    ann10.title = @"AQ 3148";
    ann10.subtitle = @"Micro Computer Facility, Lab Help Desk";
    ann10.coordinate = coor10;
    [_mapView addAnnotation : ann10];
    
    Annotation *ann11 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor11;
    coor11.latitude = 49.279895;
    coor11.longitude = -122.922139;
    ann11.title = @"WMX2502";
    ann11.subtitle = @"West Mall Lab";
    ann11.coordinate = coor11;
    [_mapView addAnnotation : ann11];
    
    [_mapView setRegion : region animated : YES];
} // end goComp


//  goFood() contains coordinates for food services.

- (void) goFood
{
    MKCoordinateRegion region;
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [self.mapView removeAnnotations : self.mapView.annotations];
    
    Annotation *ann1 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor1;
    coor1.latitude = 49.278630;
    coor1.longitude = -122.918676;
    ann1.title = @"The Ladle";
    ann1.subtitle = @"soup, vegetarian";
    ann1.coordinate = coor1;
    [_mapView addAnnotation : ann1]; 
    
    Annotation *ann2 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor2;
    coor2.latitude = 49.278127;
    coor2.longitude = -122.912165;
    ann2.title = @"Renaissance Coffee";
    ann2.subtitle = @"coffee/tea, fast food";
    ann2.coordinate = coor2;
    [_mapView addAnnotation : ann2];
    
    Annotation *ann3 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor3;
    coor3.latitude = 49.280030;
    coor3.longitude = -122.921377;
    ann3.title = @"Tim Hortons";
    ann3.subtitle = @"donuts, coffee/tea, fast food";
    ann3.coordinate = coor3;
    [_mapView addAnnotation : ann3];
    
    Annotation *ann4 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor4;
    coor4.latitude = 49.278103;
    coor4.longitude = -122.912034;
    ann4.title = @"Himalayan Peak";
    ann4.subtitle = @"Indian Restaurant, Indian Food";
    ann4.coordinate = coor4;
    [_mapView addAnnotation : ann4];
    
    Annotation *ann5 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor5;
    coor5.latitude = 49.279278;
    coor5.longitude = -122.917276;
    ann5.title = @"Triple O's";
    ann5.subtitle = @"burger, fast food";
    ann5.coordinate = coor5;
    [_mapView addAnnotation : ann5];
    
    Annotation *ann6 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor6;
    coor6.latitude = 49.277807;
    coor6.longitude = -122.911925;
    ann6.title = @"Donair Town";
    ann6.subtitle = @"Mediterranean, Middle Eastern, Donair, fast food";
    ann6.coordinate = coor6;
    [_mapView addAnnotation : ann6];
    
    Annotation *ann7 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor7;
    coor7.latitude = 49.277815;
    coor7.longitude = -122.911967;
    ann7.title = @"Pizza Point";
    ann7.subtitle = @"pizza, fast food";
    ann7.coordinate = coor7;
    [_mapView addAnnotation : ann7];
    
    Annotation *ann8 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor8;
    coor8.latitude = 49.277827;
    coor8.longitude = -122.912023;
    ann8.title = @"Spicy Stone";
    ann8.subtitle = @"korean";
    ann8.coordinate = coor8;
    [_mapView addAnnotation : ann8];
    
    Annotation *ann9 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor9;
    coor9.latitude = 49.278798;
    coor9.longitude = -122.919036;
    ann9.title = @"Higher Grounds Coffee and Highland Pub";
    ann9.subtitle = @"coffee/tea, pub food";
    ann9.coordinate = coor9;
    [_mapView addAnnotation : ann9];
    
    Annotation *ann10 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor10;
    coor10.latitude = 49.278590;
    coor10.longitude = -122.918753;
    ann10.title = @"Mr.Sub";
    ann10.subtitle = @"sandwiches";
    ann10.coordinate = coor10;
    [_mapView addAnnotation : ann10];
    
    Annotation *ann11 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor11;
    coor11.latitude = 49.277841;
    coor11.longitude = -122.9121115;
    ann11.title = @"Bamboo Garden";
    ann11.subtitle = @"chinese";
    ann11.coordinate = coor11;
    [_mapView addAnnotation : ann11];
    
    Annotation *ann12 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor12;
    coor12.latitude = 49.278001;
    coor12.longitude = -122.911457;
    ann12.title = @"Nature's Garden Organic Deli";
    ann12.subtitle = @"Coffee/Tea, Delicatessen, Organic";
    ann12.coordinate = coor12;
    [_mapView addAnnotation : ann12];
    
    Annotation *ann13 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor13;
    coor13.latitude = 49.2780885;
    coor13.longitude = -122.911942;
    ann13.title = @"Booster Juice";
    ann13.subtitle = @"Smoothies, Sandwiches/Subs";
    ann13.coordinate = coor13;
    [_mapView addAnnotation : ann13];
    
    Annotation *ann14 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor14;
    coor14.latitude = 49.278060;
    coor14.longitude = -122.911831;
    ann14.title = @"Ichibankan Express Sushi";
    ann14.subtitle = @"Japanese, Sushi";
    ann14.coordinate = coor14;
    [_mapView addAnnotation : ann14];
    
    Annotation *ann15 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor15;
    coor15.latitude = 49.279117;
    coor15.longitude = -122.917365;
    ann15.title = @"Simon C's Convenience Store";
    ann15.subtitle = @"general, soup, snacks, coffee/tea";
    ann15.coordinate = coor15;
    [_mapView addAnnotation : ann15];
    
    Annotation *ann16 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor16;
    coor16.latitude = 49.278977;
    coor16.longitude = -122.915656;
    ann16.title = @"Mackenzie Cafe";
    ann16.subtitle = @"cafeteria, deli, bbq, stir-fry, sandwichs";
    ann16.coordinate = coor16;
    [_mapView addAnnotation : ann16];
    
    Annotation *ann17 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor17;
    coor17.latitude = 49.278539;
    coor17.longitude = -122.918786;
    ann17.title = @"Bubble World";
    ann17.subtitle = @"bubble tea, drinks";
    ann17.coordinate = coor17;
    [_mapView addAnnotation : ann17];
    
    Annotation *ann18 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor18;
    coor18.latitude = 49.278623;
    coor18.longitude = -122.918826;
    ann18.title = @"Koya Japan";
    ann18.subtitle = @"japanese, fast food";
    ann18.coordinate = coor18;
    [_mapView addAnnotation : ann18];
    
    Annotation *ann19 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor19;
    coor19.latitude = 49.278073;
    coor19.longitude = -122.911971;
    ann19.title = @"Club Ilia";
    ann19.subtitle = @"Pub Food, Mediterranean";
    ann19.coordinate = coor19;
    [_mapView addAnnotation : ann19];
    
    
    Annotation *ann20 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor20;
    coor20.latitude = 49.277800;
    coor20.longitude = -122.911740;
    ann20.title = @"Romeo and Juliet";
    ann20.subtitle = @"bubble tea, gelato";
    ann20.coordinate = coor20;
    [_mapView addAnnotation : ann20];

    Annotation *ann21 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor21;
    coor21.latitude = 49.280954;
    coor21.longitude = -122.916595;
    ann21.title = @"Diamond Alumni Centre";
    ann21.subtitle = @"buffet, cuisine";
    ann21.coordinate = coor21;
    [_mapView addAnnotation : ann21];
    
    Annotation *ann22 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor22;
    coor22.latitude = 49.277734;
    coor22.longitude = -122.914004;
    ann22.title = @"Renaissance Coffee";
    ann22.subtitle = @"coffee/tea";
    ann22.coordinate = coor22;
    [_mapView addAnnotation : ann22];
    
    Annotation *ann23 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor23;
    coor23.latitude = 49.279421;
    coor23.longitude = -122.916053;
    ann23.title = @"Renaissance Coffee";
    ann23.subtitle = @"coffee/tea";
    ann23.coordinate = coor23;
    [_mapView addAnnotation : ann23];
    
    [_mapView setRegion : region animated : YES];
}  //end goFood


//  goBus() contains coordinates for bus stops.

- (void)goBus
{
    MKCoordinateRegion region;
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [self.mapView removeAnnotations : self.mapView.annotations];
    
    //Buses
    Annotation *ann1 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor1;
    coor1.latitude = 49.279696;
    coor1.longitude = -122.920248;
    ann1.title = @"SFU Transportation Centre Bay 1";
    ann1.subtitle = @"(135, 143, 144, 145, N35)";
    ann1.coordinate = coor1;
    [_mapView addAnnotation : ann1]; 
    
    Annotation *ann2 = [[Annotation alloc] init];
    CLLocationCoordinate2D coor2;
    coor2.latitude = 49.279791;
    coor2.longitude = -122.919880;
    ann2.title = @"SFU Transportation Centre Bay 2";
    ann2.subtitle = @"(135, 143, 144, 145, N35)";
    ann2.coordinate = coor2;
    [_mapView addAnnotation : ann2];
    
    Annotation *ann3 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor3;
    coor3.latitude = 49.279977;
    coor3.longitude = -122.19502;
    ann3.title = @"SFU Transportation Centre Bay 3";
    ann3.subtitle = @"(135, 143, 144, 145, N35)";
    ann3.coordinate = coor3;
    [_mapView addAnnotation : ann3];
    
    Annotation *ann4 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor4;
    coor4.latitude = 49.278599;
    coor4.longitude = -122.912881;
    ann4.title = @"SFU Transit Exchange Bay 1";
    ann4.subtitle = @"(145)";
    ann4.coordinate = coor4;
    [_mapView addAnnotation : ann4];
    
    Annotation *ann5 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor5;
    coor5.latitude = 49.278527;
    coor5.longitude = -122.912752;
    ann5.title = @"SFU Transit Exchange Bay 2";
    ann5.subtitle = @"(135, N35)";
    ann5.coordinate = coor5;
    [_mapView addAnnotation : ann5];
    
    Annotation *ann6 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor6;
    coor6.latitude = 49.278507;
    coor6.longitude = -122.912655;
    ann6.title = @"SFU Transit Exchange Bay 3";
    ann6.subtitle = @"(144)";
    ann6.coordinate = coor6;
    [_mapView addAnnotation : ann6];
    
    Annotation *ann7 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor7;
    coor7.latitude = 49.278529;
    coor7.longitude = -122.912524;
    ann7.title = @"SFU Transit Exchange Bay 4";
    ann7.subtitle = @"(143)";
    ann7.coordinate = coor7;
    [_mapView addAnnotation : ann7];
    
    Annotation *ann8 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor8;
    coor8.latitude = 49.277332;
    coor8.longitude = -122.919255;
    ann8.title = @"WB S Campus Rd FS Science Rd";
    ann8.subtitle = @"(135, 143, 144, 145, N35)";
    ann8.coordinate = coor8;
    [_mapView addAnnotation : ann8];
    
    Annotation *ann9 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor9;
    coor9.latitude = 49.281311;
    coor9.longitude = -122.927769;
    ann9.title = @"WB University Dr w FS w Campus Rd";
    ann9.subtitle = @"(135, 143, 144, 145, N35)";
    ann9.coordinate = coor9;
    [_mapView addAnnotation : ann9];
    
    Annotation *ann10 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor10;
    coor10.latitude = 49.277500;
    coor10.longitude = -122.909245;
    ann10.title = @"SB Tower Rd FS University High St";
    ann10.subtitle = @"(135, 143, 144, 145, N35)";
    ann10.coordinate = coor10;
    [_mapView addAnnotation : ann10];
    
    [_mapView setRegion : region animated : YES];
} //end goBus


//  goPark() contains coordinates for parking lots.

- (void) goPark
{
    MKCoordinateRegion region;
    region.center.latitude = 49.278165;
    region.center.longitude = -122.917871;
    region.span.latitudeDelta = 0.022;
    region.span.longitudeDelta =0.02;
    
    [self.mapView removeAnnotations : self.mapView.annotations];
    
    //Parking Lots
    Annotation *ann11 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor11;
    coor11.latitude = 49.275566;
    coor11.longitude = -122.908532;
    ann11.title = @"Temporary Public Parking 1";
    ann11.coordinate = coor11;
    [_mapView addAnnotation : ann11];
    
    Annotation *ann12 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor12;
    coor12.latitude = 49.276681;
    coor12.longitude = -122.908494;
    ann12.title = @"Parking Lot G";
    ann12.coordinate = coor12;
    [_mapView addAnnotation : ann12];
    
    Annotation *ann13 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor13;
    coor13.latitude = 49.276660;
    coor13.longitude = -122.911182;
    ann13.title = @"Parking Lot B";
    ann13.coordinate = coor13;
    [_mapView addAnnotation : ann13];
    
    Annotation *ann14 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor14;
    coor14.latitude = 49.277223;
    coor14.longitude = -122.910211;
    ann14.title = @"Visitor Parking B Lot";
    ann14.coordinate = coor14;
    [_mapView addAnnotation : ann14];
    
    Annotation *ann15 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor15;
    coor15.latitude = 49.280229;
    coor15.longitude = -122.913805;
    ann15.title = @"Visitor Parking C Lot";
    ann15.coordinate = coor15;
    [_mapView addAnnotation : ann15];
    
    Annotation *ann16 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor16;
    coor16.latitude = 49.280607;
    coor16.longitude = -122.921503;
    ann16.title = @"Visitor Parking N Lot";
    ann16.coordinate = coor16;
    [_mapView addAnnotation : ann16];
    
    Annotation *ann17 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor17;
    coor17.latitude = 49.280352;
    coor17.longitude = -122.925687;
    ann17.title = @"Reserved Resident Parking";
    ann17.coordinate = coor17;
    [_mapView addAnnotation : ann17];
    
    Annotation *ann18 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor18;
    coor18.latitude = 49.280348;
    coor18.longitude = -122.912180;
    ann18.title = @"Parking Lot C";
    ann18.coordinate = coor18;
    [_mapView addAnnotation : ann18];
    
    Annotation *ann19 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor19;
    coor19.latitude = 49.280023;
    coor19.longitude = -122.923585;
    ann19.title = @"Visitor's Parkade";
    ann19.coordinate = coor19;
    [_mapView addAnnotation : ann19];
    
    Annotation *ann20 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor20;
    coor20.latitude = 49.276343;
    coor20.longitude = -122.917249;
    ann20.title = @"Parking Lot F";
    ann20.coordinate = coor20;
    [_mapView addAnnotation : ann20];
    
    Annotation *ann21 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor21;
    coor21.latitude = 49.275739;
    coor21.longitude = -122.911568;
    ann21.title = @"Parking Lot D";
    ann21.coordinate = coor21;
    [_mapView addAnnotation : ann21];
    
    Annotation *ann22 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor22;
    coor22.latitude = 49.278798;
    coor22.longitude = -122.913322;
    ann22.title = @"Parking Lot E";
    ann22.coordinate = coor22;
    [_mapView addAnnotation : ann22];
    
    Annotation *ann23 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor23;
    coor23.latitude = 49.279677;
    coor23.longitude = -122.907625;
    ann23.title = @"Parking Lot H";
    ann23.coordinate = coor23;
    [_mapView addAnnotation : ann23];
    
    Annotation *ann24 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor24;
    coor24.latitude = 49.277629;
    coor24.longitude = -122.910890;
    ann24.title = @"The Hub and Cornerstone Parking";
    ann24.subtitle = @"pay parking";
    ann24.coordinate = coor24;
    [_mapView addAnnotation : ann24];
    
    Annotation *ann25 = [[Annotation alloc] init];    
    CLLocationCoordinate2D coor25;
    coor25.latitude = 49.275183;
    coor25.longitude = -122.911504;
    ann25.title = @"Parking Lot P3";
    ann25.coordinate = coor25;
    [_mapView addAnnotation : ann25];
    
    [_mapView setRegion : region animated : YES];
} //end Park


/*  NAME:       getMyLocation()
 *              formerly getmycurrentlocation()
 *
 *  PURPOSE:    Controls the activation and disabling of the phone's location service.
 */

- (IBAction)getMyLocation : (id)sender
{
    _mapView.showsUserLocation = YES;    
    [mapView setCenterCoordinate : mapView.userLocation.coordinate animated : YES];
}


/*  NAME:       setMap()
 *              formerly setmymap()
 *
 *  PURPOSE:    Controls the background Google Maps type: that is, whether the user is seeing
 *              a standard map view, a satellite only view, or a hybrid view that overlays the
 *              standard map on top of the sattelite view.
 */
- (IBAction)setMap : (id)sender
{
    if (_mapView.mapType == MKMapTypeStandard)
    {
        _mapView.mapType = MKMapTypeSatellite;
        [mapDesc setTitle: @"Sattelite" forState:UIControlStateNormal];
    }
    else if (_mapView.mapType == MKMapTypeSatellite)
    {
        _mapView.mapType = MKMapTypeHybrid;
        [mapDesc setTitle: @"Hybrid" forState:UIControlStateNormal];
    }
    else
    {
        _mapView.mapType = MKMapTypeStandard;
        [mapDesc setTitle: @"Map" forState:UIControlStateNormal];
    }
}


/*  NAME:       viewDidUnload()
 *
 *  PURPOSE:    The series of tasks that should be done when the user exits this view (or
 *              the application).
 */

- (void)viewDidUnload
{
    [self setMap : nil];
    [self setLocationmanager : nil];
    [self setLocationmanager : nil];

    [super viewDidUnload];
    
}

- (BOOL)shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
    {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } 
    else 
    {
        return YES;
    }
}

@end